WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WPopupMenu",function(r,c,s){function i(){j(c,null);c.style.display="none";setTimeout(function(){r.emit(c.id,"cancel")},0)}function t(a,b){$(a).toggleClass("active",b)}function l(a){if(a.subMenu)return a.subMenu;else{var b=a.lastChild;if(b&&d.hasTag(b,"UL")){a.subMenu=b;b.parentItem=a;$(b).mousemove(u);m(b);return b}else return null}}function A(a){a.style.display="block";if(a.parentNode==a.parentItem){a.parentNode.removeChild(a);c.parentNode.appendChild(a)}var b=
d.px(a,"paddingTop")+d.px(a,"borderTopWidth");d.positionAtWidget(a.id,a.parentItem.id,d.Horizontal,-b);j(a,null)}function j(a,b){function v(h,e){if(h==e)return true;else if(e)return(e=e.parentNode.parentItem)?v(h,e):false;else return false}function n(h){var e,w;e=0;for(w=h.childNodes.length;e<w;++e){var f=h.childNodes[e];if(v(f,b)){if(f!==b)(f=l(f))&&n(f)}else{t(f,false);if(f=l(f)){f.style.display="none";n(f)}}}}n(a)}function u(a){for(a=d.target(a);a&&!d.hasTag(a,"LI")&&!d.hasTag(a,"UL");)a=a.parentNode;
if(d.hasTag(a,"LI"))if(a!==o){o=a;t(a,true);var b=l(a);b&&A(b);j(c,a)}}function B(){p=false;clearTimeout(g);if(s>=0)g=setTimeout(i,s)}function C(){p=true;clearTimeout(g)}function m(a){$(a).mouseleave(B).mouseenter(C)}function q(){return document.getElementById(c.id)!=null}function x(a){k=true;q()&&d.button(a)!=1&&i()}function y(){if(k&&q()){k=false;i()}}function z(a){q()&&a.keyCode==27&&i()}jQuery.data(c,"obj",this);var d=r.WT,g=null,p=false,o=null,k=false;this.setHidden=function(a){a||(k=false);
if(g){clearTimeout(g);g=null}p=false;o=null;if(a){c.style.position="";c.style.display="";c.style.left="";c.style.top="";$(document).unbind("mousedown",x);$(document).unbind("click",y);$(document).unbind("keydown",z)}else{setTimeout(function(){$(document).bind("mousedown",x);$(document).bind("click",y);$(document).bind("keydown",z)},0);c.style.display="block"}j(c,null)};this.popupAt=function(a){m(a)};setTimeout(function(){m(c)},0);$(c).mousemove(u)});
